﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameManager : MonoBehaviour
{
    //地图数组：有方块为1，无方块为0
    private int[,] map;
    private bool initNewBlock;
    private GameObject currentBlock;
    public Transform spawnPoint;
    public GameObject baseBlock;

    private void Start()
    {
        initNewBlock = false;
        map = new int[10, 20];
        for (int i = 0; i < 10; i++)
        {
            for (int j = 0; j < 20; j++)
            {
                map[i, j] = 0;
            }
        }
    }

    private void Update()
    {
        if (!initNewBlock)
        {
            InitBlock();
        }
    }

    public void InitBlock()
    {
        currentBlock = GameObject.Instantiate(baseBlock, spawnPoint.position, spawnPoint.rotation);
        currentBlock.GetComponent<Rigidbody>().velocity = new Vector3(0, -1, 0);
        initNewBlock = true;
    }
}
